import { history } from '@umijs/max';
import { Button, Result } from 'antd';
import React from 'react';

const NoFoundPage: React.FC = () => (
  <Result
    status="404"
    title="404"
    subTitle="哎呀，页面走丢了哇"
    extra={
      <Button type="primary" onClick={() => {
        if (location.pathname.indexOf('/m/') === -1) {
          // PC版本
          history.push('/');
        }else{
          history.push('/m/analyse');
        }
      }}>
        首页
      </Button>
    }
  />
);

export default NoFoundPage;
